package com.cs.study.homework._0217;

public class Demo1 {
    static {
        System.out.println("Demo类开始初始化步骤了!");
    }

    static Cat cat = new Cat();
    Dog dog = new Dog();

    public static void main(String[] args) {
        System.out.println("hello world!");
        Demo1 d = new Demo1();
    }

    public Demo1() {
        System.out.println("demo");
    }
}

class Cat {
    static {
        System.out.println("Cat类开始初始化步骤了!");
    }

    static Dog dog = new Dog();

    public Cat() {
        System.out.println("cat");
    }
}

class Dog {
    static {
        System.out.println("Dog类开始初始化步骤了!");
    }

    static Demo1 demo = new Demo1();

    public Dog() {
        System.out.println("dog");
    }
}